def sort(a, N):
    for i in range (N-1) :
        for j in range(N-i-1):
            if a[j] > a[j+1]:
                a[j], a[j+1] = a[j+1], a[j]

def read(filename): 
	file = open(filename, 'r')    
	data = file.readlines()    
	return data
import time
mass1 = read("m1_sorted.txt")
size = len(mass1)
t_start = time.time()
sort(mass1, size)
t_finish = time.time()
print("m1_sorted",round((t_finish-t_start)*1000),"milliseconds")

mass2 = read("m2_reverse.txt")
size = len(mass2)
t_start = time.time()
sort(mass2, size)
t_finish = time.time()
print("m2_reverse",round((t_finish-t_start)*1000),"milliseconds")

mass3 = read("m3_shuffle.txt")
size = len(mass3)
t_start = time.time()
sort(mass3, size)
t_finish = time.time()
print("m3_shuffle",round((t_finish-t_start)*1000),"milliseconds")
